<?php
	include_once("king_head.php");

?>

<?php
	include_once("ClsSebent/config.php");

if("$action"=="Save" && $_SESSION['SITE_ID'] != "")
{
	if($updates=='')$updates='N';
		$sql="UPDATE site_home SET meta_keywords='$meta_keywords',meta_description='$meta_description', meta_title='$meta_title', u_sitemeta='$updates' WHERE id='".$_SESSION['SITE_ID']."'";
		//echo $sql;
		mysql_query($sql);	   


	//*********Global Updation.
	$qry="Select site_id from reseller where updates='Y'";
	$res=mysql_query($qry);
	if($_SESSION['SITE_ID']==101)
	{
		while($rowx=mysql_fetch_row($res))
		{
			$sid=$rowx[0];
			$uq="Select u_sitemeta from site_home where id=$sid";
			echo $uq;
			$ur=mysql_query($uq);
			$urw=mysql_fetch_array($ur);
			if(($urw['u_sitemeta']=='Y') && ($sid!=0))
			{
			$qry="UPDATE site_home SET meta_keywords='$meta_keywords',meta_description='$meta_description', meta_title='$meta_title' WHERE id='$sid'";		
			echo $qry;
			mysql_query($qry);	   
			}//if
		}//while
	}//if
	
		echo "<H4><FONT COLOR=red>Meta-tags Update Successfully!</font></H4><BR>";
}//if(save..
	
	$sql="SELECT * FROM site_home WHERE id=$_SESSION['SITE_ID']";

	$result = mysql_query($sql);
	if($row=mysql_fetch_array($result))
	{
		$meta_keywords=$row["meta_keywords"];
		$meta_description=$row["meta_description"];
		$meta_title=$row["meta_title"];		
	}
?>

<CENTER>
<H2> Website's default Meta-tags</H2>
<form enctype="multipart/form-data"  method="post"><input type=hidden name=site_id value="<?php echo $_SESSION['SITE_ID']; ?>">
<TABLE>
<tr><td>Meta title </td><td><input name=meta_title value="<?php echo $meta_title; ?>" size=100 maxlength=100></td></tr>
<tr><td>Meta Description </td><td><textarea name=meta_description rows=5 cols=80><?php echo $meta_description; ?></textarea></td></tr>
<tr><td>Meta Keyword <BR><FONT SIZE=1>(Keyword should<BR>be saprated<BR>by ",")</FONT></td><td><textarea name=meta_keywords rows=5 cols=80><?php echo $meta_keywords; ?></textarea></td></tr>
<TR><td height="38" width="88">Updates</td><td height="38" colspan="2"><input type="checkbox" name=updates <?php if($row['u_sitemeta']=='Y')echo"checked";?> value="Y" size=20>&nbsp;</td></tr>
<td colspan=2 align=center><input type=submit name=action value=Save></TD>
</TR>
</TABLE></form>
</CENTER>

<?php
	include_once("king_foot.php");
?>